
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
    pageEncoding="UTF-8"%>
 <%@ page import="javax.servlet.http.*" %>  
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Alta Libros</title>
<script type="text/javascript" src="jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js"></script>
 <script src="formValidation.js" type="text/javascript"></script>
</head>

<body  background="/stylesheets/biblio.png">


	
	<% String accion = request.getParameter("accion");
	   String isbn = request.getParameter("isbn");
       String titulo=request.getParameter("titulo");
       String autor=request.getParameter("autor");
       String editorial=request.getParameter("editorial");
       Boolean tieneCD=Boolean.parseBoolean(request.getParameter("tieneCD"));
	
	 if (accion.compareTo("alta")== 0 || accion.compareTo("")== 0 ){ %>
	 <fieldset>
	 	<h1 align="center" align="justify">Altas de Libros</h1>
	 </fieldset>
	  		
	 <fieldset>	
	
 		<h3>Datos del Libro</h3>		
		
	
		<form action="altaLibros.jsp?accion=alta" method="post" name="valLibro">
		
		<table border=0>
			
			<tr height="50">
			<td>ISBN:</td>
			<td><input type="text" name="isbn" size="18" maxlength="18" required="required">
			</td>
			
			<tr>
			<td>TITULO:</td>
			<td><input type="text" name="titulo" required="required">
			</td>
			</tr>
			
			<tr>
			<td>AUTOR:</td> 
			<td><input type="text" name="autor" required="required">
			</td>
			</tr>
			
			<tr>
			<td>EDITORIAL:</td>
			<td><input type="text" name="editorial" required="required">
			</td>
			</tr> 
			
			<tr>
			<td>TIENE CD:</td> 
			<td><select name="tieneCD"><option>Si<option SELECTED>No</select></td>
			</tr>
			
			<tr>
			<td>DESCRIPCIÓN:</td>
			 <td><textarea name="content" rows="3" cols="60" required="required"></textarea></td>
			 </tr>
			 
			 <tr>
			 <td>
				<input type="submit" value="Enviar formulario"></td>
				<td><input type="reset" value="Borrar">  </td>
				<td> <input type="button" value="Volver" onclick="history.back()"> </td>
				</tr>
				</table>
		</form>	
	 </fieldset>
	 
	<%}else if(accion.compareTo("error")== 0){%>
		<table border=1 >
 			<tr>
 				<td>
 					Error de datos
 					<h6>no has introducido algun dato</h6>
 					<a href="altaLibros.jsp?accion=alta">atras</a>
 				</td>
 			</tr>
 		</table>
	<%} %>
</body>
</html>